package com.fecean.aabbc.netty.client.controller;

import com.fecean.aabbc.netty.client.init.ClientChannel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private ClientChannel clientChannel;

    @GetMapping("/test")
    public String test(@RequestParam("text") String text){
        if(clientChannel != null && text != null){
            clientChannel.writeAndFlush(text);
        }
        return "TestController.test.text = " + text;
    }
}
